#!/bin/bash
SERVICE_PORT=8080
SERVICE_DIR=target/
SERVICE_NAME=mall-admin-1.0.jar
SERVICE_LOG=mall.log

function killproject()
{
  project_pid=$(netstat -lnp | grep $SERVICE_PORT|awk '{print $7}'|cut -d/ -f1)
  if [  $project_pid > 0 ]; then
        echo $SERVICE_NAME "已经启动，正在关闭项目，pid为: $project_pid "
        kill -9 $(netstat -lnp | grep $SERVICE_PORT|awk '{print $7}'|cut -d/ -f1)
        echo $SERVICE_NAME '关闭成功。。。'
  else
        echo $SERVICE_NAME "没有启动。。。"
  fi
}

killproject